package com.mi.action;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.mi.service.BrandService;

@Controller
public class BrandAction {
	private Map<String, Object> map;

	@Resource
	private BrandService brandService;
	private String brandName;
	
	/**
	 * 调用service查询主页所需要的全部数据
	 * @return
	 */
	public String allBrand() {
		map = brandService.getAllBrand();
		return "success";
	}
	
	/**
	 * 调用service根据名字查询
	 * @return
	 */
	public String byName() {
		brandService.getByBrand(brandName);
		return "success";
	}

	public Map<String, Object> getMap() {
		return map;
	}

	public void setMap(Map<String, Object> map) {
		this.map = map;
	}

	public String getBrandName() {
		return brandName;
	}

	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}
}
